<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="Promise.js"></script>
</head>
<body>

<script>
    //执行器函数  是同步执行的
    let p = new Promise((resolve, reject) => {
        console.log(000);
        // resolve('ok');
        reject('error');
    })

    //回调执行是异步的
    p.then(value => {
        console.log(111);
    }, reason => {
        console.error(reason);
    });

    console.log(222);
</script>
</body>
</html>